﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using System.Text;

namespace IHISCETeim.Web.MachineSys.UserModel
{
    public partial class UAgentMacStockListCheckReport : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.查看 };
            }
        }
        protected override string DWZRef
        {
            get
            {
                return "UAgentMacStockListCheckReport";
            }
        }
        #region 属性 (查询条件)

        protected string CreateDateFrom
        {
            get
            {
                return GetRequestValue<string>("CreateDateFrom", DateTime.Now.ToString("yyyy-MM-01"));


            }
        }

        protected string CreateDateTo
        {
            get
            {
                return GetRequestValue<string>("CreateDateTo", Convert.ToDateTime(CreateDateFrom).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd"));
                //
               
            }
        }





        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            DataBind();
            if (GetRequestValue<string>("exportexecl", "0") == "1")
            {

            }
            AddLog(Permission.查看);
        }
        protected DataTable SUMDT = null;
        protected void DataBind()
        {
            DataTableCollection DTC = UClaimDemageController.GetCheckReport(CreateDateFrom, CreateDateTo);
            this.rpMenu.DataSource = DTC[0];
            this.rpMenu.DataBind();
           // SUMDT = DTC[1];
        }

      

        protected string GetPer(object d1, object d2)
        {
            if (d1 is DBNull)
                return "100";
            if (d2 is DBNull)
                return "0";

            if (Convert.ToDouble(d1) == 0)
                return "100";

            return (Convert.ToDouble(Convert.ToDouble(d2) / Convert.ToDouble(d1))*100).ToString("f2");

           // return (Convert.ToInt32(d1) - Convert.ToInt32(d2)).ToString();
        }
    }
}